﻿<ul class="nav-items">
    <% if(!locals.isAdmin) { %>
        <li><a href="/">Shop</a></li>
        <li><a href="/cart">Cart <span
                        class="badge"><%= locals.cart.totalQuantity %></span></a>
        </li>
    <% } %>

    <% if(locals.isAuth && !locals.isAdmin ) { %>
        <li><a href="/orders">Orders</a>
        </li>
    <% } %>

    <% if(locals.isAdmin) { %>
        <li><a href="/admin/products">Manage
                Products</a>
        <li><a href="/admin/orders">Manage
                Orders</a>
        </li>
    <% } %>

    <% if (!locals.isAuth) { %>
        <li><a href="/signup">Signup</a>
        </li>
        <li><a href="/login">Login</a>
        </li>
    <% } %>

    <% if (locals.isAuth) { %>
        <li>
            <form action="/logout"
                  method="POST">
                <input type="hidden"
                       name="_csrf"
                       value="<%= locals.csrfToken %>">
                <button>Logout</button>
            </form>
        </li>
    <% } %>

</ul>